<template>
	<view>
		
		<view class="home">
			<view class="homeImg homeImg2"></view>
			
			<!-- 1.nav开始 -->
			<view class="bigBox bigBox1">
				<view class="title">
					<text class="boxTitle">教务管理</text>
				</view>
				<view v-for="(item,index) in msg" :key="index" class="elseMsg elseMsgWidth" @click="grade(index)">
					<view class="img" :class="im[index]"></view>
					<text>{{msg[index]}}</text>
				</view>
			</view>
			<!-- nav结束 -->
			
			<!-- 2.校园论坛开始 -->
			<view class="bigBox bigBox1">
				<view class="title">
					<text class="boxTitle">推荐</text>
					<text class="more">更多</text>
				</view>
				<view class="lunRight">
					<view v-for="(item,index) in recommend" :key="index" class="elseMsg elseMsgWidth2">
						<view class="serviceImg" :class="im2[index]"></view>
						<text class="serviceText">{{recommend[index]}}</text>
					</view>
				</view>
			</view>
			<!-- 校园论坛结束 -->
		
		</view>
	</view>
</template>

<script>
	export default {
		name: "IndexHeader",
		data() {
			return {
				background: ['color1', 'color2'],
				indicatorDots: true,
				autoplay: true,
				interval: 2000,
				duration: 500,
				im:["serviceImg1","serviceImg2","serviceImg3","serviceImg4",
					"serviceImg5","serviceImg6","serviceImg7","serviceImg8"],
				im2:["serviceImg9","serviceImg10","serviceImg11","serviceImg12","serviceImg13","serviceImg14"],
				msg:["请假","报修","请假记录","维修记录","邮箱","物品领用","盖章申请","待办"],
				recommend:["数学交叉中心成功举办交流会","百世山大祝福你一 校庆日签","3D9名教师入选山东省高等学..",
					"集团再次捐资支持百甘山大","数学交叉中心成功举办交流会","百世山大祝福你一 校庆日签"],
			}
		},
		methods:{
			changeIndicatorDots(e) {
				this.indicatorDots = !this.indicatorDots
			},
			changeAutoplay(e) {
				this.autoplay = !this.autoplay
			},
			intervalChange(e) {
				this.interval = e.target.value
			},
			durationChange(e) {
				this.duration = e.target.value
			},
			grade(index){
				if(index === 0 ){
					uni.navigateTo({
						url: 'leave'
					});
				}else if(index === 1){
					uni.navigateTo({
						url: 'repair'
					});
				}else if(index === 2){
					uni.navigateTo({
						url: '../grade/leave'
					});
				}else if(index === 3){
					uni.navigateTo({
						url: '../grade/repair'
					});
				}else if(index === 5){
					uni.navigateTo({
						url: 'goods'
					});
				}
			}
		}
	}
</script>

<style scoped src="../../static/css/home.css"></style>
<style scoped src="../../static/css/service.css"></style>
